import React, { Component } from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import AuthRoute from './components/AuthRoute';
import Layout from './pages/Layout';
import Login from './pages/Login';
import Test from 'pages/test';
import history from './utils/history';
export default class App extends Component {
  render() {
    return (
      <Router history={history}>
        <div className="App">
          <Switch>
            {/* 重定向的/一般要和e xact精准匹配 配合使用 */}
            {/* <Redirect path="/" to="/layout" exact></Redirect> */}
            <Route path="/test" component={Test}></Route>
            <Route path="/login" component={Login}></Route>
            {/* 删除layout的匹配路径，修改模糊匹配 */}
            <AuthRoute path="/" component={Layout}></AuthRoute>
          </Switch>
        </div>
      </Router>
    );
  }
}
